Skip to content

feat: add spam penalty threshold for leaderboard ranking#129

Closed
amitb0ra wants to merge 2 commits intoRocketChat:masterfrom
amitb0ra:feat/spam-penalty
Closed

feat: add spam penalty threshold for leaderboard ranking#129
amitb0ra wants to merge 2 commits intoRocketChat:masterfrom
amitb0ra:feat/spam-penalty

Conversation

@amitb0ra
Copy link
Copy Markdown
Contributor

@amitb0ra amitb0ra commented Mar 25, 2026

Summary

Adds a configurable spamPenaltyThreshold that demotes contributors with excessive open PRs or issues below non-penalized contributors who have merged PRs. This helps surface genuine contributors over spam-heavy accounts.

How it works

When spamPenaltyThreshold is set to a value > 0 (e.g. 10):

  1. Contributors whose openPRsNumber >= threshold OR issuesNumber >= threshold are marked as penalized
  2. Non-penalized contributors with at least 1 merged PR are ranked in a top tier — they always appear above penalized contributors
  3. Within each tier, the existing sort order (merged PRs, open PRs, issues) is preserved
  4. When threshold is 0 or absent, ranking behaves exactly as before (no penalty applied)

Results

image image image

Copy link
Copy Markdown
Member

@Sing-Li Sing-Li left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not a good idea to use env var for this. Should be UI driven from admin panel. Please change.

- Add configurable spamPenaltyThreshold to demote spam-heavy contributors
- Add POST /setSpamPenaltyThreshold admin endpoint (UI-driven per reviewer feedback)
- Expose spamPenaltyThreshold in GET /config response
- Pass threshold to API.getRanks() in /rank and /contributor endpoints
- Apply penalty sort in frontend (fetch config before data)
- Add spamPenaltyThreshold to config-example.json
@amitb0ra amitb0ra force-pushed the feat/spam-penalty branch from 799782c to 65fe204 Compare March 27, 2026 03:48
@amitb0ra amitb0ra requested a review from Sing-Li March 27, 2026 03:49
@Sing-Li
Copy link
Copy Markdown
Member

Sing-Li commented Mar 27, 2026

don't change any file that doesn't involve the new ranking code -- like don't change the ci workflow!

I think you need to review and understand each step that the agent proposes when vibe coding and don't just agree to every modification it wants to do (never run it in YOLO mode!). Typically, you'll need to revise its proposed action 10s of times in a vibe coding session.

@amitb0ra
Copy link
Copy Markdown
Contributor Author

don't change any file that doesn't involve the new ranking code -- like don't change the ci workflow!

I think you need to review and understand each step that the agent proposes when vibe coding and don't just agree to every modification it wants to do (never run it in YOLO mode!). Typically, you'll need to revise its proposed action 10s of times in a vibe coding session.

thanks for the review. added UI in admin panel also. but i haven't changed ci. could you clarify what you're seeing?

@Sing-Li
Copy link
Copy Markdown
Member

Sing-Li commented Mar 30, 2026

Screenshot 2026-03-30 at 1 14 22 PM

@amitb0ra the problem is that you don't really know what the agent is doing when you used YOLO mode. It has committed CI on your behalf. Then it messed up Github history by doing a forced push. That basically wasted a lot of your and my time.

Please do a clean, human examined (every line) PR, and make sure your description of the problem conform to our CONTRIBUTING guidelines (which you wrote) - explicitly stating the involvement of AI in the PR.

I'll do both of us a favour and close this one.

@Sing-Li Sing-Li closed this Mar 30, 2026
@amitb0ra amitb0ra deleted the feat/spam-penalty branch April 1, 2026 17:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants